<template>
	<view class="collection">
		<view class="title">人气藏品</view>
		<view class="row" v-for="(item, index) in list" :key="index">
			<view class="col left">
				<u--image radius="5" width="300rpx" height="300rpx" mode="aspectFill" :src="item.cover"></u--image>
			</view>
			<view class="col right">
				<view class="name">{{item.name}}</view>
				<view class="artist">
					<text class="label">艺术家</text>
					<text class="value nickname">{{item.artistName}}</text>
				</view>
				<view class="artist">
					<text class="label">价格</text>
					<text class="value price">￥{{$util.thousands(item.price)}}</text>
				</view>
				<view class="intro">{{item.intro}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { mapState, mapGetters, mapActions, mapMutations } from 'vuex'
	export default {
		components: {},
		data() {
			return {
				query: {
					page: 1,
					limit: 10
				},
				list: []
			}
		},
		mounted() {
			this.getMarketList(this.query).then(res => {
				this.list = res.rows
			})
		},
		methods: {
			...mapActions("market", ["getMarketList"]),
		}
	}
</script>

<style lang="scss" scoped>
	.collection{
		margin-top: 20rpx;
		.title{
			padding-bottom: 30rpx;
			font-weight: bold;
			font-size: 28rpx;
		}
		.row{
			padding: 20rpx 20rpx;
			margin-bottom: 20rpx;
			background-color: #484b5e;
			border-radius: 10rpx;
			display: flex;
			justify-content: space-between;
			.right{
				font-size: 25rpx;
				.name{
					font-weight: bold;
					font-size: 28rpx;
				}
				.artist{
					display: flex;
					justify-content: space-between;
					padding: 10rpx 0 20rpx 0;
					color: #cacaca;
					.price{
						font-size: 28rpx;
						color: #fac22b;
					}
					.nickname{
						color: #ffffff;
					}
				}
				.intro{
					height: 130rpx;
					width: 100%;
					text-overflow: ellipsis;
					overflow: hidden;
					color: #cacaca;
				}
			}
			.col{
				width: 50%;
			}
		}
	}
</style>
